const Mock = require('mockjs');
let Random=Mock.Random;
Random.extend({
    getDormId:  function () {
        let array = [412,413,414,415];
        return this.pick(array);
    },
    getGender:  function () {
        let array = ["男","女"];
        return this.pick(array);
    }
})

let data1 = Mock.mock({
    "stulist|50":[{
    "id|+1":1,
    "name":"@cname",
    "gender":"@getGender",
    "phone":/^1[3456789]\d{9}$/,
    "dorm":"@getDormId",
    "dormroom":/\d{3}/,
    }]
})

let data2 = Mock.mock({
    "dMlist|10":[{
    "id|+1":1,
    "name":"@cname",
    "gender":"@getGender",
    "phone":/^1[3456789]\d{9}$/,
    "dormm":"@getDormId",
    }]
})

let data3 = Mock.mock({
    "dlist|10":[{
    "id|+1":1,
    "name":"@cname",
    "gender":"@getGender",
    "phone":/^1[3456789]\d{9}$/,
    "dormm":"@getDormId",
    }]
})
// 输出结果 {data:{books:[{}{}{}]}} data对象有数组属性，
//数组属性有100个对象
module.exports ={
    stulist: data1.stulist,
    dMlist: data2.dMlist
}